package com.showde.shoppingmall.netentity;

import com.kim.net.NetEntity;
import com.showde.shoppingmall.ShoppingMallApplication;
import com.showde.shoppingmall.business.InformationFetchBusiness.INFOMATION_TYPE;
import com.showde.shoppingmall.utils.URLS;

public class InformationFetchEntity extends NetEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3307107328282789434L;

	private String actionType;

	public InformationFetchEntity(INFOMATION_TYPE type) {
		switch (type) {
		case CJWT:
			actionType = "cjwt";
			break;
		case GJP:
			actionType = "gjp";
			break;
		case JGBH:
			actionType = "jgbh";
			break;
		case KHFW:
			actionType = "khfw";
			break;
		}
	}

	@Override
	protected void init() {
		this.url = URLS.URL_GJP;
	}

	@Override
	protected void initHttpHeader() {

	}

	@Override
	public String getSendData() {
		String userAccount = ShoppingMallApplication.userSession
				.getSessionUser().getUserAccount();
		String password = ShoppingMallApplication.userSession.getSessionUser()
				.getUserPassword();
		String sendData = "{\"Account\":\"" + userAccount
				+ "\",\"Password\":\"" + password + "\",\"ActType\":\""
				+ actionType + "\"}";
		return sendData;
	}

}
